Skip to content

Skip processed artifacts when reprocessing a run - #200

Merged
wasimxyz merged 2 commits into
stagingfrom
cursor/reprocess-raw-files-only
Aug 21, 2026
Merged

Skip processed artifacts when reprocessing a run#200
wasimxyz merged 2 commits into
stagingfrom
cursor/reprocess-raw-files-only

Conversation

@wasimxyz

@wasimxyz wasimxyz commented Aug 21, 2026

Copy link
Copy Markdown
Member

The problem

Clicking Reprocess on a run queued every file on it — including the posters, videos and CSVs that Data Hub generated itself. The Lambda only knows how to read original instrument files, so it looked at those, decided they weren't its job, and quietly did nothing. The files were left sitting in processing forever with nothing to move them along.

DishCam hit this hardest: its posters are .jpg, which is also an extension the watcher picks up as raw data.

What changes

Only original files can be reprocessed. Generated files are skipped by run-level Reprocess, rejected with a clear error by the API and the MCP tool, and no longer show a Reprocess button.

When the Lambda can't handle a file, it now says so. A manual reprocess used to skip the filename check entirely, so the file reached a processor that ignored it and left it stuck. Now an unrecognised file is marked failed with a reason you can read on the row — same as when the instrument is missing or has no processor. This closes the same bug for original files with unexpected names, like a stray .txt on a DishCam run.

Not fixed here

Files already stuck in processing from earlier reprocesses stay stuck — the app won't reprocess a file in that state. They need a one-off PATCH /api/v1/files/:id back to uploaded.

Test plan

  • Web unit: canReprocessFile rejects generated files, allows raw ones
  • Lambda unit: an unrecognised reprocess is marked failed; a matching one still runs
  • Web integration: per-file reprocess returns 409 for a generated file, and run reprocess queues only the raw file
  • In the UI, Reprocess is hidden on generated rows and still works on raw uploaded/failed/completed files
  • Reprocess a DishCam run and confirm no posters or videos are queued

Made with Cursor

Processed posters and videos often match watcher filename patterns, so
run reprocess queued them and left them stuck in processing.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
data-hub Ready Ready Preview Aug 21, 2026 4:40pm

Request Review

@wasimxyz wasimxyz self-assigned this Aug 21, 2026
Skipping the filename gate on Function URL invokes was meant to keep a
user-initiated reprocess from being silently dropped, but processors
return without touching the file row when the name isn't theirs, so the
web app's `processing` transition was left with nothing to resolve it.
The gate now always runs and a mismatch is PATCHed to `failed`, matching
the existing recovery for a missing instrument or unmapped type.

Also derive `ReprocessableFile` from the `files` row so a mistyped
category or status literal fails to compile.

Co-authored-by: Cursor <cursoragent@cursor.com>
@wasimxyz
wasimxyz merged commit 02d63f3 into staging Aug 21, 2026
6 checks passed
@wasimxyz
wasimxyz deleted the cursor/reprocess-raw-files-only branch August 21, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant